package com.duanjw.springframework.aop.config;

import com.duanjw.springframework.aop.dao.UserDao;
import com.duanjw.springframework.aop.dao.impl.UserDaoImpl;
import com.duanjw.springframework.aop.dao.impl.UserDaoImpl2;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

/**
 * 配置
 * proxyTargetClass false（默认），如果代理对象实现了接口，使用jdk代理。如果没有实现接口，使用CGLIB代理
 *
 * ---

 *
 * @author duanjw
 */
@ComponentScan("com.duanjw.springframework.aop")
@Configuration
public class AppConfig {
    @Bean
    public UserDaoImpl userDaoImpl(){
        return new UserDaoImpl();
    }

    @Bean
    public UserDaoImpl2 userDaoImpl2(){
        userDaoImpl();
        return new UserDaoImpl2();
    }


}
